package com.xique.park.controller.app;

import com.xique.common.core.web.domain.AjaxResult;
import com.xique.park.bean.request.comm.VlprRequest;
import com.xique.park.service.biz.service.IvlprBizService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.UnsupportedEncodingException;

/**
 * 移动端手动进出场controller
 */
@RestController
@RequestMapping("/app/handInOut")
public class AppHandInOutController {

    @Autowired
    private IvlprBizService ivlprBizService;

    /**
     * 图片车牌识别，返回识别车牌结果
     * 调用百度API服务
     * @param request
     * @return
     */
    @PostMapping("/vlpr")
//    @PreAuthorize(hasPermi = "park:vlpr:query")
    public AjaxResult vlpr(@Validated @RequestBody VlprRequest request) throws UnsupportedEncodingException {
        return ivlprBizService.baiduVlpr(request.getImage());
    }

}
